{% extends 'layout.html' %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">文章列表</h3>
        </div>
        <div class="panel-body">

            <a href="{% url 'backend:article_add' %}" class="btn btn-primary">添加</a>
            <table class="table table-hover table-bordered" style="margin-top: 20px;">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>标题</th>
                    <th>分类</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for article in all_artitle %}
                    <tr>
                        <td>{{ forloop.counter }}</td>
                        <td>{{ article.title }}</td>
                        <td>{{ article.category }}</td>
                        <td>

                            <a href="{% url 'backend:article_edit' article.pk %}"><i class="fa fa-edit"></i></a>
                            <a href="{% url 'backend:article_del' article.pk %}"><i class="fa fa-trash-o"></i></a>

                        </td>
                    </tr>
                {% endfor %}

                </tbody>
            </table>
        </div>
    </div>
{% endblock %}